//
// Created by mac on 1/27/22.
//

#include <vector>
using namespace std;
vector<int> plusOne(vector<int>& digits) {
    for (int i = digits.size() - 1; i >= 0; i--) {
        digits[i]++;
        digits[i] = digits[i] % 10;
        if (digits[i] != 0) return digits;
    }

    vector<int> res(digits.size() + 1);
    res[0] = 1;
    return res;

}